import { lazy } from "react";
import { createBrowserRouter } from "react-router-dom";

import { HomeO, FriendsO, UserO } from '@react-vant/icons'
const App = lazy(() => import("../App"));
const One = lazy(() => import("../Page/One"));

const Login = lazy(() => import("../Page/Login"));
const ZhuCe = lazy(() => import("../Page/ZhuCe"));

// 恢复医生列表页面（问专家）
const DiseaseDetail = lazy(() => import("../Page/DiseaseDetail"));
// 医生列表页面
const DoctorList = lazy(() => import("../Page/DoctorList"));
// 医生详情页面
const DoctorDetail = lazy(() => import("../Page/DoctorDetail"));
// 关注的医生列表页面
const FollowedDoctors = lazy(() => import("../Page/FollowedDoctors"));
// 药品详情页面
const DrugDetail = lazy(() => import("../Page/DrugDetail"));

// 病友圈主页面
const SickCircle = lazy(() => import("../Page/SickCircle/index"));

// 视频页面


const Message = lazy(() => import("../Page/Message"));
const Search = lazy(() => import("../Page/Search"));
const SickCircleDetail = lazy(() => import("../Page/SickCircleDetail"));
const InformationDetail = lazy(() => import("../Page/InformationDetail"));
const PingLun = lazy(() => import("../Page/PingLun"));
const SickCirclePublish = lazy(() => import("../Page/SickCirclePublish"));

const Cases = lazy(() => import("../Page/Cases"));
const Mine = lazy(() => import("../Page/Mine"));
const Fen = lazy(() => import("../Page/Fen"));
const PermissionTest = lazy(() => import("../Page/PermissionTest"));
const ChangePassword = lazy(() => import("../Page/ChangePassword"));

// OAuth回调页面
const GiteeCallback = lazy(() => import("../Page/Auth/GiteeCallback"));

export const Zi = [
    {
        path: "one",
        element: <One />,
        title: "就医",
        icon: <HomeO />
    },
    {
        path: "message",
        element: <Message />,
        title: "AI 智能客服",
        icon: <FriendsO />
    },

    {
        path: "cases",
        element: <Cases />,
        title: "视频",
        icon: <FriendsO />
    },
    {
        path: "mine",
        element: <Mine />,
        title: "我的",
        icon: <UserO />
    }
]

const router = createBrowserRouter([
    {
        path: "/",
        element: <App />,
        children: [
            {
                index: true,
                element: <One />
            }
        ]
    },
    {
        path: "/app",
        element: <App />,
        children: Zi
    },
    {
        path: "/login",
        element: <Login />
    },
    {
        path: "/zhuce",
        element: <ZhuCe />
    },
    // OAuth回调路由
    {
        path: "/auth/gitee/callback",
        element: <GiteeCallback />
    },
    // 问专家（医生列表）
    {
        path: "/disease-detail",
        element: <DiseaseDetail />
    },
    // 医生列表页面
    {
        path: "/doctor-list",
        element: <DoctorList />
    },
    // 医生详情页面
    {
        path: "/doctor-detail/:doctorId",
        element: <DoctorDetail />
    },
    // 关注的医生列表页面
    {
        path: "/followed-doctors",
        element: <FollowedDoctors />
    },
    // 疾病详情页面
    {
        path: "/disease-detail/:id",
        element: <DiseaseDetail />
    },
    // 药品详情页面
    {
        path: "/drug-detail/:id",
        element: <DrugDetail />
    },
    // 病友圈主页面
    {
        path: "/sick-circle",
        element: <SickCircle />
    },
    // 视频页面


    {
        path: "/information-detail",
        element: <InformationDetail />
    },

    {
        path: "/search",
        element: <Search />
    },
    // 病友圈详情页面
    {
        path: "/sick-circle-detail/:id",
        element: <SickCircleDetail />
    },
    {
        path: "/fen",
        element: <Fen />
    },
    {
        path: "/pinglun",
        element: <PingLun />
    },
    {
        path: "/sick-circle-publish",
        element: <SickCirclePublish />
    },
    {
        path: "/permission-test",
        element: <PermissionTest />
    },
    {
        path: "/change-password",
        element: <ChangePassword />
    },

])
export default router